import 'package:flutter/material.dart';

class GYLocalizations {
  final Locale locale;

  GYLocalizations(this.locale);

  /* 创建一个Map,里面放着不同环境的语言环境文本 */
  static Map<String, Map<String, String>> _localizedValues = {
    "en": {
      "title": "home",
      "greet": "Internationalization testing",
      "picktime": "Pick a Time"
    },
    "zh": {
      "title": "首页",
      "greet": "国际化测试",
      "picktime": "选择一个时间"
    }
  };

  String get title {
    return (_localizedValues[locale.languageCode]?["title"]) ?? "";
  }
  String get greet {
    return (_localizedValues[locale.languageCode]?["greet"]) ?? "";
  }
  String get picktime {
    return (_localizedValues[locale.languageCode]?["picktime"]) ?? "";
  }

}